﻿Imports System
Imports System.Collections.Generic

Namespace System.Workflow.ComponentModel
    <Serializable> _
    Friend Class GrantedLock
        Implements ICloneable
        ' Methods
        Public Sub New(ByVal holder As Activity)
            Me.holder = holder
            Me.waitList = New List([Of] Activity)
        End Sub

        Public Function Clone() As Object
            Dim lock As New GrantedLock(Me.holder)
            lock.waitList.InsertRange(0, Me.waitList)
            Return lock
        End Function


        ' Properties
        Public Property Holder As Activity
            Get
                Return Me.holder
            End Get
            Set(ByVal value As Activity)
                Me.holder = value
            End Set
        End Property

        Public ReadOnly Property WaitList As IList([Of] Activity)
            Get
                Return Me.waitList
            End Get
        End Property


        ' Fields
        Private holder As Activity
        Private waitList As List([Of] Activity)
    End Class
End Namespace

